package cn.libinal.scloud.winter.entity;

import cn.libinal.scloud.base.common.entity.JpaBaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;


/**
 * @author libinal
 */
@Entity
@Table(name = "w_product")
@EqualsAndHashCode(callSuper = true)
@Data
public class Product extends JpaBaseEntity {
    private static final long serialVersionUID = -5642863130770792720L;

    @Column(name = "product_name", length = 100)
    @NotNull
    private String name;

    @Column(name = "product_price", columnDefinition = "double(8,2) default 0")
    private Double price;

    @Column(name = "create_time")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
}
